﻿<UserControl x:Class="ViCode_LeVi.Controls.VMResultOfStep"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data"
        >
    <UserControl.Resources>
        <BooleanToVisibilityConverter  x:Key="BooleanToVisibilityConverter" />
    </UserControl.Resources>
    <GroupBox  DockPanel.Dock="Right" Width="200">
        <GroupBox.Header>
            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="Group_StepResult_Header"/>
        </GroupBox.Header>
        <DockPanel>
            <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Description}">
                    <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Bad, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Bad, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Bad, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
                    </Ellipse>
                    <Grid Name="Grid_RadioButton_Bad">
                        <!--GroupName="CheckTab"-->
                        <RadioButton Name="RadioButton_Bad" IsChecked="{Binding Is_StepResult_Bad}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Bad}, Path=Description}"/>
                    </Grid>

                </Grid>

                <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Description}">
                    <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Normal, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Normal, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Normal, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
                    </Ellipse>
                    <Grid Name="Grid_RadioButton_Normal">
                        <!--GroupName="CheckTab"-->
                        <RadioButton  Name="RadioButton_Normal" IsChecked="{Binding Is_StepResult_Normal}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Normal}, Path=Description}"/>
                    </Grid>

                </Grid>

                <Grid ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Description}">
                    <Ellipse Fill="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Color}" 
                                             Width="{Binding ElementName = Grid_RadioButton_Good, Path = ActualWidth}"
                                             Height="{Binding ElementName = Grid_RadioButton_Good, Path = ActualHeight}"
                                                 Visibility="{Binding ElementName = RadioButton_Good, Path = IsChecked, Converter ={StaticResource BooleanToVisibilityConverter}}">
                    </Ellipse>
                    <Grid Name="Grid_RadioButton_Good">
                        <!--GroupName="CheckTab"-->
                        <RadioButton Name="RadioButton_Good" IsChecked="{Binding Is_StepResult_Good}" Margin="5,2,2,2" 
                                                 Background="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Color}"
                                                 ToolTip="{Binding Source={x:Static Data:StepResult.StepResultItem_Good}, Path=Description}"/>
                    </Grid>

                </Grid>
            </StackPanel>
            <vmcontrol:VMTextBox_MultiLine x:Name="TextBox_Note" Margin="2" Text="{Binding Note}" AcceptsReturn="True"  ScrollViewer.VerticalScrollBarVisibility="Auto" >

            </vmcontrol:VMTextBox_MultiLine>
        </DockPanel>
    </GroupBox>
</UserControl>
